<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="../scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../ext-3.2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext-3.2.1/ext-all.js"></script>
<script type="text/javascript" src="../scripts/jquery_rollScroll.js"></script>
<style type="text/css">
<!-- 
	body,html{
		margin: 0;
		padding: 0;
		padding-right: 15px;
	}
	body,html,span,td{
		font-family: Helvetica,Arial,sans-serif;
		font-size: 13px;
	}
	fieldset{margin-top: 15px;padding-right: 10px;padding-left: 10px;border:1px dotted #2657A1;
	filter:progid:DXImageTransform.microsoft.gradient(gradienttype=0,startColorStr=white,endColorStr=#DFF0F7);
	background: -webkit-gradient(linear, left top, left bottom, from(white), to(#DFF0F7));
	background: -moz-linear-gradient(top, white, #DFF0F7);
	cursor: pointer;}
	legend{border:1px dashed red;
	background: -webkit-gradient(linear, left top, right bottom, from(pink), to(white));
	background: -moz-linear-gradient(left, pink, white);
	filter:progid:DXImageTransform.microsoft.gradient(gradienttype=1,startColorStr=pink,endColorStr=white);font-size:18px;font-family:隶书;}
	.tipDiv{height: 100px;padding: 0}
	table{;border-top: 1px solid #7FCAEA;;}
	table td,table th{text-align: center;border-bottom: 1px solid #7FCAEA;;border-right: 1px solid #7FCAEA;height: 25px;}
	.mouse_over{background: #CBF0BB}
	.current_followup{font-size: 15px;letter-spacing: 2px;font-weight: 600;}
-->
</style>
</head>
<body>
<div align="right"><img title="刷新" onclick="window.location.reload();" alt="刷新" src="../resources/images/reflash.png" style="cursor: pointer;"/></div>
<fieldset id="move" style="display: none" uri="#" title="双击迁入人员记录以执行迁入操作">
	<legend>迁入人员提醒：</legend>
	<table style="margin-top: 10px;" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="12%">姓名</td><td width="8%">性别</td><td width="20%">出生日期</td><td width="25%">身份证号</td><td style="border-right:0px">现住地地址</td></tr></table>
	<div class="tipDiv" id="moveContent">
		
	</div>
</fieldset>

<fieldset id="moving" style="display: none" uri="#" title="双击迁出人员记录以修改该信息">
	<legend>迁出人员提醒：</legend>
	<table style="margin-top: 10px;" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="12%">姓名</td><td width="8%">性别</td><td width="20%">出生日期</td><td width="25%">身份证号</td><td style="border-right:0px">现住地地址</td></tr></table>
	<div class="tipDiv" id="movingContent">
		
	</div>
</fieldset>

<fieldset id="moveBack" style="display: none" uri="#" title="双击迁出人员记录以修改该信息">
	<legend>迁出人员撤回提醒：</legend>
	<table style="margin-top: 10px;" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="12%">姓名</td><td width="8%">性别</td><td width="20%">出生日期</td><td width="25%">身份证号</td><td style="border-right:0px">现住地地址</td></tr></table>
	<div class="tipDiv" id="moveBackContent">
		
	</div>
</fieldset>

<fieldset id="submit" style="display: none" title="双击记录进行信息提交">
	<legend>暂未提交的信息列表：</legend>
	<table style="margin-top: 10px;" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="12%">姓名</td><td width="8%">性别</td><td width="20%">出生日期</td><td width="25%">身份证号</td><td style="border-right:0px">现住地地址</td></tr></table>
	<div class="tipDiv" id="submitContent">
		
	</div>
</fieldset>

<fieldset id="audit" style="display: none" title="双击记录进行信息审核">
	<legend>待审核信息列表：</legend>
	<table style="margin-top: 10px;" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="12%">姓名</td><td width="8%">性别</td><td width="20%">出生日期</td><td width="25%">身份证号</td><td style="border-right:0px">现住地地址</td></tr></table>
	<div class="tipDiv" id="auditContent">
		
	</div>
</fieldset>

<fieldset id="modify" style="display: none" title="双击记录以进行信息修订">
	<legend>已退回修订的信息列表：</legend>
	<table style="margin-top: 10px;" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="12%">姓名</td><td width="8%">性别</td><td width="20%">出生日期</td><td width="25%">身份证号</td><td style="border-right:0px">现住地地址</td></tr></table>
	<div class="tipDiv" id="modifyContent">
		
	</div>
</fieldset>

<fieldset id="followup" style="display: none" title="双击记录进行随访信息维护">
	<legend>近期需随访的病人信息列表：</legend>
	<table style="margin-top: 10px;" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="12%">姓名</td><td width="8%">性别</td><td width="20%">随访日期</td><td width="20%">下次随访日期</td><td style="border-right:0px">目前状态</td></tr></table>
	<div class="tipDiv" id="followupContent">
		
	</div>
</fieldset>
</body>
<script type="text/javascript">
var submitFlag = false;
var auditFlag = false;
var modifyFlag = false;
var followUpFlag = false;
var isHos = false;
Ext.Ajax.request({
	url : '../taTheriomaCards/tipMove.action',
	failure : function(result, request) {
		var responseArray = Ext.util.JSON.decode(result.responseText);
		Ext.Msg.show({
			title : '错误',
			msg : '<span style="text-align:center;width:250px;margin:5 0 5 0;"></span>',
			buttons : Ext.MessageBox.OK,
			icon : Ext.MessageBox.WARNING
		});
	},
	success : function(result, request) {
		var responseArray = Ext.util.JSON.decode(result.responseText);
		if(responseArray.length > 0){
			var str = '<table width="100%" style="border-top:0px" border="0" cellpadding="0" cellspacing="0">';
			for(var i = 0; i < responseArray.length; i++){
				var obj = responseArray[i];
				str += '<tr id="'+obj['rid']+'"><td width="12%">'+obj['name']+'</td><td width="8%">'+formatSex(obj['sex'])+'</td><td width="20%">'+obj['birthday']+'</td><td width="25%">'+obj['idcard']+'&nbsp;</td><td style="border-right:0px;text-align:left;padding-left:10px;" >'+(obj["currentAddr"])+'</td></tr>'
			}
			str += '</table>';
			$("#moveContent").html(str);
			$("#move").show();
			if(responseArray.length > 4){
				$("#moveContent").rollList({speed: 300, timer: 3000,step:1 });
			}
			$("#moveContent tr").hover(function(){$(this).addClass("mouse_over")},function(){$(this).removeClass("mouse_over")}).dblclick(function(){
				var id = $(this).attr("id");
				parent.onMove(id,"../taTheriomaCards/taTheriomaCardsInfo.action?idStr="+ id);
			});
		}
	}
});

Ext.Ajax.request({
	url : '../taTheriomaCards/tipMoving.action',
	failure : function(result, request) {
		var responseArray = Ext.util.JSON.decode(result.responseText);
		Ext.Msg.show({
			title : '错误',
			msg : '<span style="text-align:center;width:250px;margin:5 0 5 0;"></span>',
			buttons : Ext.MessageBox.OK,
			icon : Ext.MessageBox.WARNING
		});
	},
	success : function(result, request) {
		var responseArray = Ext.util.JSON.decode(result.responseText);
		if(responseArray.length > 0){
			var str = '<table width="100%" style="border-top:0px" border="0" cellpadding="0" cellspacing="0">';
			for(var i = 0; i < responseArray.length; i++){
				var obj = responseArray[i];
				str += '<tr id="'+obj['rid']+'"><td width="12%">'+obj['name']+'</td><td width="8%">'+formatSex(obj['sex'])+'</td><td width="20%">'+obj['birthday']+'</td><td width="25%">'+obj['idcard']+'&nbsp;</td><td style="border-right:0px;text-align:left;padding-left:10px;" >'+(obj["currentAddr"])+'</td></tr>'
			}
			str += '</table>';
			$("#movingContent").html(str);
			$("#moving").show();
			if(responseArray.length > 4){
				$("#movingContent").rollList({speed: 300, timer: 3000,step:1 });
			}
			$("#movingContent tr").hover(function(){$(this).addClass("mouse_over")},function(){$(this).removeClass("mouse_over")}).dblclick(function(){
				var id = $(this).attr("id");
				parent.onMoving(id,"../taTheriomaCards/taTheriomaCardsInfo.action?idStr="+ id);
			});
		}
	}
});


Ext.Ajax.request({
	url : '../taTheriomaCards/tipMoveBack.action',
	failure : function(result, request) {
		var responseArray = Ext.util.JSON.decode(result.responseText);
		Ext.Msg.show({
			title : '错误',
			msg : '<span style="text-align:center;width:250px;margin:5 0 5 0;"></span>',
			buttons : Ext.MessageBox.OK,
			icon : Ext.MessageBox.WARNING
		});
	},
	success : function(result, request) {
		var responseArray = Ext.util.JSON.decode(result.responseText);
		if(responseArray.length > 0){
			var str = '<table width="100%" style="border-top:0px" border="0" cellpadding="0" cellspacing="0">';
			for(var i = 0; i < responseArray.length; i++){
				var obj = responseArray[i];
				str += '<tr id="'+obj['rid']+'"><td width="12%">'+obj['name']+'</td><td width="8%">'+formatSex(obj['sex'])+'</td><td width="20%">'+obj['birthday']+'</td><td width="25%">'+obj['idcard']+'&nbsp;</td><td style="border-right:0px;text-align:left;padding-left:10px;" >'+(obj["currentAddr"])+'</td></tr>'
			}
			str += '</table>';
			$("#moveBackContent").html(str);
			$("#moveBack").show();
			if(responseArray.length > 4){
				$("#moveBackContent").rollList({speed: 300, timer: 3000,step:1 });
			}
			$("#moveBackContent tr").hover(function(){$(this).addClass("mouse_over")},function(){$(this).removeClass("mouse_over")}).dblclick(function(){
				var id = $(this).attr("id");
				parent.onMoveBack(id,"../taTheriomaCards/taTheriomaCardsInfo.action?idStr="+ id);
			});
		}
	}
});

//根据菜单加载提示内容
Ext.Ajax.request({
		url : '../menu/buildPermissionMenuJSON.action?group=',
		failure : function(result, request) {
			var responseArray = Ext.util.JSON.decode(result.responseText);
			Ext.Msg.show({
				title : '错误',
				msg : '<span style="text-align:center;width:250px;margin:5 0 5 0;"></span>',
				buttons : Ext.MessageBox.OK,
				icon : Ext.MessageBox.WARNING
			});
		},
		success : function(result, request) {
			var responseArray = Ext.util.JSON.decode(result.responseText);
			for(var i = 0; i < responseArray.length; i++){
				var node = responseArray[i];
				var children = node.children;
				for(var j = 0; j < children.length; j++){
					var childNode = children[j];
					if(childNode.text=="数据管理"){
						var children_ = childNode.children;
						for(var k = 0; k < children_.length; k++){
							var childNode_ = children_[k];
							if(childNode_.href.indexOf("tumor_manage.jsp")!=-1){
								submitFlag = modifyFlag = followUpFlag = true;
								$("#submit,#modify,#followup").attr("uri",childNode_.href).attr("text",childNode_.text).attr("cls",childNode_.id);
							}
							if(childNode_.href.indexOf("tumorHosp_manage.jsp")!=-1){
								submitFlag = modifyFlag = followUpFlag = true;
								isHos = true;
								$("#submit,#modify,#followup").attr("uri",childNode_.href).attr("text",childNode_.text).attr("cls",childNode_.id);
							}
							if(childNode_.href.indexOf("tumor_audit")!=-1){
								auditFlag = true;
								$("#audit").attr("uri",childNode_.href).attr("text",childNode_.text).attr("cls",childNode_.id);
							}
						}
					}
					
				}
				/*
				for(var j = 0; j < children.length; j++){
					var childNode = children[j];
					if(childNode.href.indexOf("tumor_manage.jsp")!=-1){
						submitFlag = modifyFlag = followUpFlag = true;
						$("#submit,#modify,#followup").attr("uri",childNode.href).attr("text",childNode.text).attr("cls",childNode.id);
					}
					if(childNode.href.indexOf("tumor_audit.jsp")!=-1){
						auditFlag = true;
						$("#audit").attr("uri",childNode.href).attr("text",childNode.text).attr("cls",childNode.id);
					}
				}*/
			}
			if(submitFlag){
				Ext.Ajax.request({
					url : '../taTheriomaCards/tipSubmitInfo.action',
					failure : function(result, request) {
						var responseArray = Ext.util.JSON.decode(result.responseText);
						Ext.Msg.show({
							title : '错误',
							msg : '<span style="text-align:center;width:250px;margin:5 0 5 0;"></span>',
							buttons : Ext.MessageBox.OK,
							icon : Ext.MessageBox.WARNING
						});
					},
					success : function(result, request) {
						var responseArray = Ext.util.JSON.decode(result.responseText);
						if(responseArray.length > 0){
							var str = '<table width="100%" style="border-top:0px" border="0" cellpadding="0" cellspacing="0">';
							for(var i = 0; i < responseArray.length; i++){
								var obj = responseArray[i];
								str += '<tr id="'+obj['rid']+'"><td width="12%">'+obj['name']+'</td><td width="8%">'+formatSex(obj['sex'])+'</td><td width="20%">'+obj['birthday']+'</td><td width="25%">'+obj['idcard']+'&nbsp;</td><td style="border-right:0px;text-align:left;padding-left:10px;" >'+(obj["currentAddr"])+'</td></tr>'
							}
							str += '</table>';
							$("#submitContent").html(str);
							$("#submit").show().attr("uri",$("#submit").attr("uri")+"?cardType=0");
							if(responseArray.length > 4){
								$("#submitContent").rollList({speed: 300, timer: 3000,step:1 });
							}
							$("#submitContent tr").hover(function(){$(this).addClass("mouse_over")},function(){$(this).removeClass("mouse_over")}).dblclick(function(){
								var id = $(this).attr("id");
								parent.onsubmit_therioma_card(record,id,"../taTheriomaCards/taTheriomaCardsInfo.action?idStr="+ id,"save_fun('2')");
							});
						}
					},
					params:{
						isHos:isHos
					}
				});
			}
			if(modifyFlag){
				Ext.Ajax.request({
					url : '../taTheriomaCards/tipModifyInfo.action',
					failure : function(result, request) {
						var responseArray = Ext.util.JSON.decode(result.responseText);
						Ext.Msg.show({
							title : '错误',
							msg : '<span style="text-align:center;width:250px;margin:5 0 5 0;">'
									+ responseArray.msg + '</span>',
							buttons : Ext.MessageBox.OK,
							icon : Ext.MessageBox.WARNING
						});
					},
					success : function(result, request) {
						var responseArray = Ext.util.JSON.decode(result.responseText);
						if(responseArray.length > 0){
							var str = '<table width="100%" style="border-top:0px" border="0" cellpadding="0" cellspacing="0">';
							for(var i = 0; i < responseArray.length; i++){
								var obj = responseArray[i];
								str += '<tr id="'+obj['rid']+'"><td width="12%">'+obj['name']+'</td><td width="8%">'+formatSex(obj['sex'])+'</td><td width="20%">'+obj['birthday']+'</td><td width="25%">'+obj['idcard']+'&nbsp;</td><td style="border-right:0px;text-align:left;padding-left:10px;" >'+(obj["currentAddr"])+'</td></tr>'
							}
							str += '</table>';
							$("#modifyContent").html(str);
							$("#modify").show().attr("uri",$("#modify").attr("uri")+"?cardType=3");
							if(responseArray.length > 4){
								$("#modifyContent").rollList({speed: 300, timer: 3000,step:1 });
							}
							$("#modifyContent tr").hover(function(){$(this).addClass("mouse_over")},function(){$(this).removeClass("mouse_over")}).dblclick(function(){
								var id = $(this).attr("id");
								parent.onAdd("../taTheriomaCards/taTheriomaCardsInfo.action?idStr="+id,"save_fun('1')","save_fun('2')","2");
							});
						}
					},
					params:{
						isHos:isHos
					}
				});
			}
			if(auditFlag){
				Ext.Ajax.request({
					url : '../taTheriomaCards/tipAuditInfo.action',
					failure : function(result, request) {
						var responseArray = Ext.util.JSON.decode(result.responseText);
						Ext.Msg.show({
							title : '错误',
							msg : '<span style="text-align:center;width:250px;margin:5 0 5 0;"></span>',
							buttons : Ext.MessageBox.OK,
							icon : Ext.MessageBox.WARNING
						});
					},
					success : function(result, request) {
						var responseArray = Ext.util.JSON.decode(result.responseText);
						if(responseArray.length > 0){
							var str = '<table width="100%" style="border-top:0px" border="0" cellpadding="0" cellspacing="0">';
							for(var i = 0; i < responseArray.length; i++){
								var obj = responseArray[i];
								str += '<tr id="'+obj['rid']+'"><td width="12%">'+obj['name']+'</td><td width="8%">'+formatSex(obj['sex'])+'</td><td width="20%">'+obj['birthday']+'</td><td width="25%">'+obj['idcard']+'&nbsp;</td><td style="border-right:0px;text-align:left;padding-left:10px;" >'+(obj['currentAddr'])+'</td></tr>'
							}
							str += '</table>';
							$("#auditContent").html(str);
							$("#audit").show();
							if(responseArray.length > 4){
								$("#auditContent").rollList({speed: 300, timer: 3000,step:1 });
							}
							$("#auditContent tr").hover(function(){$(this).addClass("mouse_over")},function(){$(this).removeClass("mouse_over")}).dblclick(function(){
								var id = $(this).attr("id");
								parent.onAudit_therioma_card("../taTheriomaCards/taTheriomaCardsInfo.action?idStr="+ id
																			+'&showAudit=1'
		,"save_fun('3')","save_fun('4')","save_fun('10')");
							});
						}
					}
				});
			}
		}
	});
	
	function formatSex(value){
		if(value == "1")
			return "男";
		else
			return "女";
	}
	
	$("fieldset").dblclick(function(){
		if($(this).attr("uri") != "#")
			parent.openPage($(this).attr("uri"),$(this).attr("text"),$(this).attr("cls"));
	})
	
	function currentTip(i){
		var color = "#C10000";
		if(i%2 == 0)
			color = "#F9E396";
		var currentTipObj = $(".current_followup");
		currentTipObj.css("color",color);
		setTimeout("currentTip("+(++i)+")",1000);
	}
 //$("#trendContent").rollList({speed: 80, timer: 3000,step:1 });
</script>
</html>